package Clain;
// SafetyEvent.java
import Strategy.Coordinate;

public class SafetyEvent {
    private SafetyEventType type;
    private String description;
    private boolean resolved = false;
    private Object source;        // 事件源对象
    private Coordinate location;  // 事件发生位置
    private String details;       // 详细信息
    private int code;             // 错误代码
    private long timestamp;       // 事件时间戳

    public SafetyEvent(SafetyEventType type, String description) {
        this.type = type;
        this.description = description;
        this.timestamp= timestamp;
    }

    // 新增构造函数，支持更多参数
    public SafetyEvent(SafetyEventType type, String description, Object source,
                       Coordinate location, String details, int code) {
        this.type = type;
        this.description = description;
        this.source = source;
        this.location = location;
        this.details = details;
        this.code = code;
    }

    // Getter方法
    public SafetyEventType getType() {
        return type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setType(SafetyEventType type) {
        this.type = type;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public boolean isResolved() {
        return resolved;
    }

    public void setResolved(boolean resolved) {
        this.resolved = resolved;
    }

    // 新增方法
    public Object getSource() {
        return source;
    }

    public Coordinate getLocation() {
        return location;
    }

    public String getDetails() {
        return details;
    }

    public int getCode() {
        return code;
    }

    // Setter方法
    public void setSource(Object source) {
        this.source = source;
    }

    public void setLocation(Coordinate location) {
        this.location = location;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public void setCode(int code) {
        this.code = code;
    }
}